import request from '@/utils/request'
 
export default({
    getPlan(){
        return request({
            url:'/person/plan/list',
            method:'GET'
        })
    },
    //添加培训接口
    addPlan(data){
        console.log(data)
        return request({
            url:'/person/plan/save',
            method:'POST',
            params:{
                "id":data.id,
                "userId": data.userId[0],
                "name": data.name,
                "content": data.content,
                "endDate": data.endDate,
                "status": data.status,
                "startDate":new Date(data.startDate).getFullYear()+'-'+(new Date(data.startDate).getMonth()+1)+'-'+new Date(data.startDate).getDate(),
                "updateTime":new Date(data.startDate).getFullYear()+'-'+(new Date(data.startDate).getMonth()+1)+'-'+new Date(data.startDate).getDate(),
                "createTime":new Date(data.startDate).getFullYear()+'-'+(new Date(data.startDate).getMonth()+1)+'-'+new Date(data.startDate).getDate()
            }
        })
    },
    // 修改接口
    modifyPlan(data){
        return request({
            url:'/person/plan/update',
            method:'POST',
            params:{
                "id":data.id,
                "userId": data.userId[0],
                "name": data.name,
                "content": data.content,
                "endDate": data.endDate,
                "status": data.status,
                "startDate":new Date(data.startDate).getFullYear()+'-'+(new Date(data.startDate).getMonth()+1)+'-'+new Date(data.startDate).getDate(),
                "updateTime":new Date(data.startDate).getFullYear()+'-'+(new Date(data.startDate).getMonth()+1)+'-'+new Date(data.startDate).getDate(),
                "createTime":new Date(data.startDate).getFullYear()+'-'+(new Date(data.startDate).getMonth()+1)+'-'+new Date(data.startDate).getDate()          
            }
        })
    },
    //删除接口
    deletePlan(ids){
         return request({
             url:'/person/plan/delete',
             method:'POST',
             params:{
                 
                    "ids":ids
                
             }
         })
    }
})